﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UserInfoForm.aspx.cs" Inherits="FBKPI.Forms.UserInfoForm" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#btn_savepassword").click(function () {

                var newpass = $("#txt_newpassword").val();
                var confirmpass = $("#txt_confirmnewpassword").val();

                if (newpass != confirmpass) {
                    alert('New Password does not match the confirm new password');
                    return false;
                }
                else if (newpass.length < 5) {
                    alert('New password must be more than 5 characters');
                    return false;
                }
                else {
                    var param = "?";
                    param = param + "action=changepassword";
                    param = param + "&ID=" + $("#txt_user").val();
                    param = param + "&Password=" + $("#txt_newpassword").val();
                    ProcessRequest("EmployeeHandler.ashx" + param, "#divuserinfo", null);
                    return false;
                }
            });

            $("#btn_saveuserinfo").click(function () {
                var param = "?";
                param = param + "action=saveinfo";
                param = param + "&ID=" + $("#txt_user").val();
                param = param + "&FirstName=" + $("#txt_firstname").val();
                param = param + "&LastName=" + $("#txt_lastname").val();
                param = param + "&Phone=" + $("#txt_phonenumber").val();
                ProcessRequest("EmployeeHandler.ashx" + param, "#divuserinfo", null);
                return false;
            });
        });
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <div id="userinfoformarea" class="ui-widget-content padding5px ui-corner-all">
            <b style="margin-left:5px">User Info</b>
            <table class="dialogTable">
                <tr>
                    <td width="140px">First Name</td>
                    <td class="Separator">:</td>
                    <td><asp:TextBox ID="txt_firstname" runat="server" class="longtext"></asp:TextBox></td>
                </tr>
                <tr>
                    <td>Last Name</td>
                    <td>:</td>
                    <td><asp:TextBox ID="txt_lastname" runat="server" class="longText"></asp:TextBox></td>
                </tr>
                <tr>
                    <td>Phone Number</td>
                    <td>:</td>
                    <td><asp:TextBox ID="txt_phonenumber" runat="server" class="longText"></asp:TextBox></td>
                </tr>
                <tr>
                    <td colspan="3">
                        <button id="btn_saveuserinfo" class="ui-button ui-corner-all ui-button ui-state-default ui-button-text-icon-primary" runat="server" name="btnSave">
                            <span class="ui-button-icon-primary ui-icon ui-icon-check"></span>
                            <label class="ui-button-text">
                                Save</label>
                        </button>
                    </td>
                </tr>
            </table>
        </div>
        <br />
        <div id="AuditInformation" class="ui-widget-content padding5px ui-corner-all">
            <b style="margin-left:5px">Change Password</b>
            <table class="dialogTable">
                <tr>
                    <td width="140px">Current Password</td>
                    <td class="Separator">:</td>
                    <td><asp:TextBox ID="txt_currentpassword" runat="server" class="longText" TextMode="Password"></asp:TextBox></td>
                </tr>
                <tr>
                    <td>New Password</td>
                    <td>:</td>
                    <td><asp:TextBox ID="txt_newpassword" runat="server" class="longText" TextMode="Password"></asp:TextBox></td>
                </tr>
                <tr>
                    <td>Confirm New Password</td>
                    <td>:</td>
                    <td><asp:TextBox ID="txt_confirmnewpassword" runat="server" class="longText" TextMode="Password"></asp:TextBox></td>
                </tr>
                <tr>
                    <td colspan="3">
                        <button id="btn_savepassword" class="ui-button ui-corner-all ui-button ui-state-default ui-button-text-icon-primary" runat="server" name="btnSave">
                            <span class="ui-button-icon-primary ui-icon ui-icon-check"></span>
                            <label class="ui-button-text">
                                Save</label>
                        </button>
                    </td>
                </tr>
            </table>
        </div>
    </form>
</body>
</html>
